package com.snake.springboot.authority.service.event;

import com.snake.springboot.authority.api.model.AuthRuleModel;
import org.springframework.context.ApplicationEvent;

import java.util.List;

/**
 * 类 {@code AuthRuleLoadEvent}  <br> .
 * <p>加载权限规则事件</p>
 * 创建时间：2024/6/3 16:31
 *
 * @author yzhui
 * @see
 */

public class LoadAuthRuleEvent extends ApplicationEvent {

    private List<AuthRuleModel> authRules;

    private int permsFlag;

    public LoadAuthRuleEvent(Object source) {
        super(source);
    }

    public LoadAuthRuleEvent(Object source, int permsFlag) {
        super(source);
        this.permsFlag = permsFlag;
    }

    public List<AuthRuleModel> getAuthRules() {
        return authRules;
    }

    public void setAuthRules(List<AuthRuleModel> authRules) {
        this.authRules = authRules;
    }

    public int getPermsFlag() {
        return permsFlag;
    }

    public void setPermsFlag(int permsFlag) {
        this.permsFlag = permsFlag;
    }

    public static class  PermsFlag {

        public static int PERMS_FLAG_INTERCEPT = 0;

        public static int PERMS_FLAG_WHITELIST = 1;

    }
}
